package com.etc.singleton;

/**
 * 单例模式2 ->饿汉
 */
public class Singleton2 {
	private static Singleton2 instance = null;
	static {
		//静态代码段=>控制线程安全->JVM
		instance = new Singleton2();
	}
	private Singleton2() {}
	public static Singleton2 getInstance() {
		return instance;
	}
}
